<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head xmlns="http://www.w3.org/1999/html">
    <th:block th:include="include::header('排期管理')"/>
    <link rel="stylesheet" th:href="@{/plugins/ganttCustom/ganttCustom.css}">
    <style>
        .febs-body-search {
            margin-bottom: 20px;
        }

        .handle_btn_content {
            height: 30px;
            margin-left: 50px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        #mainGanttBox {
            height: calc(100% - 150px);
        }

        /* 图例 */
        #symbolPage {
            position: fixed;
            z-index: 100000;
            display: none;
            width: 205px;
            /* border: 1px solid; */
            padding: 20px;
            cursor: move;
            top: 240px;
            right: calc(1% + 50px);
            background: #fff;
            animation: fadenumstyle .5s;
        }

        #symbolPage .color_block {
            width: 50px;
            height: 16px;
            display: inline-block;
        }

        #symbolPage img {
            padding-left: 25px;
        }

        #pqdialog {
            z-index: 100;
        }

        .layui-table-cell {
            font-size: 12px;
        }
    </style>

</head>

<body class="febs-container" id="febs-task">
<div class="febs-body layui-fluid" lay-title="排期管理">
    <div class="febs-body-search">
        <form class="jhg-body layui-form layui-table-form" lay-filter="task-table-form" id="task-table-form">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label layui-form-label-sm">项目经理</label>
                            <div class="layui-input-inline" style="width:126px;">
                                <input type="text" name="managers" autocomplete="off" style="width: 100%;"
                                       class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label layui-form-label-sm">项目编号</label>
                            <div class="layui-input-inline" style="width:126px;">
                                <input type="text" name="projectCode" th:value="${projectCode}" style="width: 100%;"
                                       id="projectCode"
                                       autocomplete="off"
                                       class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label layui-form-label-sm">任务编号</label>
                            <div class="layui-input-inline" style="width:126px;">
                                <input type="text" name="taskCode" id="taskCode" style="width: 100%;" autocomplete="off"
                                       class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label layui-form-label-sm">任务状态</label>
                            <div class="layui-input-block">
                                <select name="status" id="status" lay-verify="" style="width: 100%;" lay-filter="status"
                                        lay-search>
                                    <option value="">请选择</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <div id="query" class="layui-btn layui-btn-sm">
                                <em class="layui-icon">&#xe615;</em>
                                查询
                            </div>
                        </div>

                        <div class="layui-inline">
                            <div id="export" shiro:hasPermission="schedule:excel" class="layui-btn layui-btn-sm">
                                <em class="layui-icon">&#xe7e4;</em>
                                导出
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>

        <div class="febs-container" id="transforForm" style="display: none">
            <div  style="margin-left: 15px;margin-right: 15px;">
            <table lay-filter="transforTable" id="transforTable"
                   name="transforTable" lay-data="{id: 'transforTable'}"></table>
            </div>
        </div>

        <div class="febs-container" id="taskTestForm" style="display: none;">
            <div  style="margin-left: 15px;margin-right: 15px;">
            <table lay-filter="taskTestTable" id="taskTestTable"
                   name="taskTestTable" lay-data="{id: 'taskTestTable'}"></table>
            </div>
        </div>
    </div>

    <div class="handle_btn_content"  style="margin-left: 10px;">
        <div style="height: 48px;transform: translateY(0%);">
            <div class="layui-inline" shiro:hasPermission="schedule:mySchedult">
                <input type="checkbox" name="mySchedule" id="mySchedule" lay-filter="mySchedule">
                我的排期
            </div>

            <div class="layui-btn layui-btn-sm" style="margin-left: 15px;">
                <div id="oneKeyAssemblie" shiro:hasPermission="schedule:oneKeyAssemblie">
                    <em class="layui-icon">&#xe7ba;</em>
                    一键排期
                </div>
            </div>
            <div class="layui-btn layui-btn-sm" shiro:hasPermission="schedule:commit"
                 style="margin-left: 15px;" id="commit">
                <em class="layui-icon">&#xe7ba;</em>
                提交
            </div>
            <div class="layui-btn layui-btn-sm" style="margin-left: 15px;" id="audit"
                 shiro:hasPermission="schedule:audit">
                <em class="layui-icon">&#xe7f1;</em>
                一键审核通过
            </div>
            <div id="transferStation" class="layui-btn layui-btn-sm" style="margin-left: 15px;height: 30px;"
                 shiro:hasPermission="schedule:transferStation">
                <em class="layui-icon">&#xe7ba;</em>
                任务中转站
            </div>

            <div class="layui-inline"
                 style="margin-left:20px;display: none;font-size: 16px;font-weight: bold;background-color:
        yellow;height: 30px;line-height: 30px;" id="reamrkid"></div>
        </div>

        <div class="layui-inline"  style="margin-right: 50px;margin-bottom: 5px;">
            <label class="layui-form-label"
                   style="padding-left:15px;width:100px;color:#1e51c7;font-size: 16px;">日期区间: </label>
            <div class="layui-inline" id="ID-laydate-range"  style="transform: translateY(5px);">
                <input type="text" id="taskStartDate" name="taskStartDate"
                       style="width: 100px;padding-top: 5px;align-items: center; justify-content: center;text-align: center; ">
                <div style="width:10px;display:inline-block;border-top: 1px solid black;transform:
                            translateY(-6px)"></div>
                <input type="text" id="taskEndDate" style="width: 100px;padding-top: 5px;
                  align-items: center; justify-content: center;text-align: center;" name="taskEndDate">
            </div>
        </div>
    </div>


        <div id="mainGanttBox" style="height: 400px;border:1px solid #eee;margin:5px auto 0;background: #fff;">
        </div>

        <!--        <div class="febs-container"  id="scheduleDialog"  style="position: relative;overflow: auto;">-->
        <div class="layui-form" action="" lay-filter="schedule-dialog-form" id="pqdialog"
             style="position:absolute;display: none;background: aliceblue;">
            <ui>
                <li>
                    <a class="layui-btn-sm" lay-filter="modify" shiro:hasPermission="schedule:audit"
                       id="approve" onclick="approve(this)">审批</a>
                </li>
                <li>
                    <a class="layui-btn-sm" lay-filter="modify" shiro:hasPermission="schedule:edit" id="edit"
                       onclick="edit(this)">修改</a>
                </li>
                <li>
                    <a class="layui-btn-sm" shiro:hasPermission="schedule:detail" lay-filter="detail" id="detail"
                       onclick="detail(this)">详情</a>
                </li>
                <li>
                    <a class="layui-btn-sm" shiro:hasPermission="schedule:delete" lay-filter="delete" id="del"
                       onclick="del(this)">删除</a>
                </li>
                <li>
                    <a class="layui-btn-sm" type="button" shiro:hasPermission="schedule:moveTotransferStation"
                       id="transfer" onclick="transfer(this)">移至任务中转站</a>
                </li>
            </ui>
        </div>

    <div style="position: fixed;z-index: 99999;right: 1%;bottom: 2%;cursor: pointer;">
        <div style="position: fixed;z-index: 99999;right: calc(1% + 20px);top: 215px;cursor: pointer;">
            <div id="legend"
                 style="width: 35px;height: 35px;background: #5aefef94;border-radius: 35px;line-height: 34px;text-align: center;display: inline-block;color: #787ceb;">
                <span>图例</span>
            </div>
            <div id="symbolPage">
                <div style="margin-top: 10px;">
                    <span class="color_block" style="background: rgba(255, 255, 0, 1);"></span>
                    <span style="margin-left: 10px;">试验条件不完备</span>
                </div>
                <div style="margin-top: 10px;">
                    <span class="color_block" style="background: rgba(129, 211, 248, 1);"></span>
                    <span style="margin-left: 10px;">试验条件完备</span>
                </div>
                <div style="margin-top: 10px;">
                    <span class="color_block" style="background: rgba(112, 182, 3, 1);"></span>
                    <span style="margin-left: 10px;">试验中</span>
                </div>
                <div style="margin-top: 10px;">
                    <span class="color_block" style="background: rgba(170, 170, 170, 1);"></span>
                    <span style="margin-left: 10px;">已完成</span>
                </div>
                <div style="margin-top: 10px;">
                    <span class="color_block" style="background: rgba(236, 128, 141, 1);"></span>
                    <span style="margin-left: 10px;">已暂停</span>
                </div>
                <div style="margin-top: 10px;">
                    <img src="/febs/images/tuli4.png">
                    <span style="margin-left: 10px;">待提交</span>
                </div>
                <div style="margin-top: 10px;">
                    <img src="/febs/images/tuli5.png">
                    <span style="margin-left: 10px;">待审核</span>
                </div>
                <div style="margin-top: 10px;">
                    <img src="/febs/images/tuli6.png">
                    <span style="margin-left: 10px;">已驳回</span>
                </div>
            </div>
        </div>
    </div>

    </div>

    <th:block th:include="include::foot"/>

    <link rel="stylesheet" th:href="@{/plugins/ganttCustom/ganttCustom.css}">
    <script th:src="@{/febs/js/sypq/schedule/scheduleList.js(v=1)}"></script>
    <script th:src="@{/febs/js/sypq/schedule/ganttCustom.js}"></script>
    <script data-th-inline="javascript">
        var useridData = [[${userid}]];
        var isAdminData = [[${isAdmin}]];
        var permissionSet = [[${permissions}]];
    </script>

    <script type="text/html" id="operatorTool">
        <a lay-event="edit" shiro:hasPermission="schedule:edit">
            <em class="layui-icon febs-edit-area febs-blue">&#xe7a4;</em>排期</a>
        <a lay-event="del" shiro:hasPermission="schedule:delete">
            <em class="layui-icon febs-edit-area febs-red">&#xe7f9;</em>删除</a>
        <a lay-event="detail" shiro:hasPermission="schedule:detail">
            <em class="layui-icon febs-edit-area febs-red">&#xe7f9;</em>详情</a>
    </script>
</body>
</html>